package com.sunlong.jiangwei.web;


import com.sunlong.jiangwei.entity.JwSpu;
import com.sunlong.jiangwei.entity.result.Result;
import com.sunlong.jiangwei.service.IJwSpuService;
import com.sunlong.jiangwei.service.IJwStatisticsService;
import com.sunlong.jiangwei.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端统计可视化接口
 * </p>
 *
 * @author 孙龙
 * @since 2021-02-19
 */
@RestController
@RequestMapping("/jiangwei/jw-statistics")
public class JwStatisticsController {

    @Autowired
    private IJwStatisticsService jwStatisticsService;



    @PostMapping("/list")
    public Result<Map<String, Object>> list(@RequestBody Map<String,Object> map){
        Long storeId = ((Integer) map.get("storeId")).longValue();
        Map<String, Object> resultMap = jwStatisticsService.list(storeId);
        return ResultUtil.data(resultMap);
    }

}
